/**
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-19 10:00:57
 * @Description  : 连接到mongodb
 */

const storageOriginModel = require('./storageOriginModel')
const mongoose = require('mongoose')
const { mongoPath } = require('@/config/config.default')
async function mian() {
  await mongoose.connect(mongoPath)
}
mian()
  .then((res) => {
    console.log('mongoDB 连接成功')
  })
  .catch((err) => {
    console.log(err)
  })

module.exports = {
  SystemLog: mongoose.model('SystemLog', require('./systemLogModel')),
  StorageOrigin: mongoose.model('StorageOrigin', storageOriginModel)
}
